package com.yuyou.hxyy.service.api.util;

import org.apache.commons.codec.digest.DigestUtils;

import com.yuyou.hxyy.service.api.cons.CommCons;

public class MD5Util {
	
	public static String md5Hex(String key) {
		return  DigestUtils.md5Hex(key);
	}
	
	public static String md5Hex(String key,String salt) {
		return  DigestUtils.md5Hex(key+salt);
	}
	
	public static void main(String[] args) {
		System.out.println(MD5Util.md5Hex(MD5Util.md5Hex("n0tcOXnmpdkm9QNv", CommCons.INIT_PASSWORD_FRONT_SALT),CommCons.INIT_PASSWORD_ADMIN_SALT));
		System.out.println(MD5Util.md5Hex(MD5Util.md5Hex("hxyyadmin1234", CommCons.INIT_PASSWORD_FRONT_SALT),CommCons.INIT_PASSWORD_ADMIN_SALT));
		System.out.println(MD5Util.md5Hex(CommCons.INIT_PASSWORD, CommCons.INIT_PASSWORD_FRONT_SALT));
		System.out.println(MD5Util.md5Hex(CommCons.INIT_PASSWORD, CommCons.INIT_PASSWORD_ADMIN_SALT));	
		System.out.println(MD5Util.md5Hex(MD5Util.md5Hex(CommCons.INIT_PASSWORD, CommCons.INIT_PASSWORD_FRONT_SALT),CommCons.INIT_PASSWORD_ADMIN_SALT));
	}
	
}
